import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../config/config.dart';
import '../entity/goods_area_category_entity.dart';
import '../entity/goods_source_list_entity.dart';
import '../routers/routers.dart';

Widget getMallStoreModule2(BuildContext context, List<GoodsAreaCategoryData> datas) {
  return Container(
    margin: EdgeInsets.only(top: 40.w, left: 25.w, right: 25.w),
    height: 150.w,
    width: double.infinity,
    decoration: const BoxDecoration(color: Colors.transparent),
    child: Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        InkWell(
          onTap: () {
            Routes.navigateTo(context, Routes.storeHot);
          },
          child: SizedBox(
            width: 340.w,
            height: double.infinity,
            child: ClipRRect(
              borderRadius: BorderRadius.circular(12.w),
              child: CachedNetworkImage(
                imageUrl: datas[0].imgPath,
                fit: BoxFit.fill,
                width: double.infinity,
                height: double.infinity,
                errorWidget: (context, url, error) {
                  return Image.asset(
                    'assets/images/bg_default_400.png',
                    width: double.infinity,
                    height: double.infinity,
                    fit: BoxFit.fill,
                  );
                },
              ),
            ),
          ),
        ),
        InkWell(
          onTap: () {},
          child: SizedBox(
            width: 340.w,
            child: ClipRRect(
              borderRadius: BorderRadius.circular(12.w),
              child: CachedNetworkImage(
                imageUrl: datas[1].imgPath,
                fit: BoxFit.fill,
                width: double.infinity,
                height: double.infinity,
                errorWidget: (context, url, error) {
                  return Image.asset(
                    'assets/images/bg_default_400.png',
                    width: double.infinity,
                    height: double.infinity,
                    fit: BoxFit.fill,
                  );
                },
              ),
            ),
          ),
        ),
      ],
    ),
  );
}
